package com.fullstack.studyExpection;

import com.fullstack.studyExpection.Exception.Num1Exception;

public class Study01 {
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
//定义 警告的触发时机
    public void test02 (Study01 s) throws Num1Exception {
        if(s.getName().equals("dsp")){
            throw new Num1Exception(s.name+"傻逼");
        }

    }



    public static void main(String[] args) throws Num1Exception {
        Study01 n =new Study01();
        Study01 n1 =new Study01();
        n.setName("dsp");
        try {
            n.test02(n);
        } catch (Num1Exception e) {    //抛出异常
            //异常的原因
            System.out.println(e.getMessage());
            e.printStackTrace();
        }

    }
    
}
